<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>购物车</title>
    <link rel="icon" type="image/x-icon" href="/images/速康logo.jpg" >
    <link rel="stylesheet" href="/stylesheets/cart.css"/>

    <script src="/javascripts/jquery-3.1.0.min.js"></script>
    <script src="/javascripts/cart.js"></script>
    <script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=2.0&ak=H9G5X4tyPuhvHosMGue3B4RcImb2ZOod"></script>
    <script>
        $(document).ready(function () {
            $.get("/users/Session", function (data, status) {
                console.log("数据: " + data + "\n状态: " + status);
                $("#UserInfo").html(data);
            });
        });
    </script>
</head>
<body onload="Time()">

<div id="page">
    <div id="top">
        <div id="left">
            当前位置
            <div id="demo">[正在定位..]</div>
            <div id="allmap"></div>
        </div>
        <div id="right">
            <ul>
                <div class="right1"><span id="UserInfo"></span>&nbsp;</div>
                <div class="right2">
                    <li><a href="/goods/UserOrder">我的订单</a> |</li>
                    <li><a href="/users/ShowUser">个人中心 |</a></li>
                    <li><a href="/Help">帮助中心</a> |</li>
                    <!--<li style="color:#C7A875">400-007-1234 |</li>-->
                    <li>手机APP |</li>
                    <li><a href="/users/glyLogin">管理员</a></li>
                </div>
            </ul>
        </div>
    </div>
    <div id="menu1">
        <div id="div1">
            <a href="/"> <img src="/images/速康logo.jpg" alt="" style="width: 80px;height: 80px"></a></div>
        <div id="div2"> |</div>
        <div id="div3"> 速康送药<br>您身边的<br>健康专家！</div>
        <a href="/goods/searchGood">
            <div id="div4"><input type="text" placeholder="   &nbsp请输入商品名"
                                  style="width: 380px;height: 40px;border:2px solid #0CA2DE;font-size: 14px;"></div>
            <div id="div5"><img src="/images/search.png"
                                style="padding-left: 18px;padding-top: 11px;width: 20px;height: 20px;"></div></a>
        <div id="div6">
            <div style="float: left;padding-top: 20px;"><img src="/images/电话.png" alt=""></div>
            <div style="float: left;margin-top: -5px;"><P style="font-size: 20px">400-010-1234 选药品<br><b>60</b>分钟内免费送到家
                </P></div>
        </div>
    </div>
    <hr>

    <div class="shoppingcart">
        <h2 style="margin-left: 160px">购物车</h2>
        <form id="frmUploadFile" action="/goods/Order" method='post'>
            <table style="margin: auto;margin-bottom: -20px">
                <thead>
                <tr>
                    <th style="width: 78px"><label><input class="check-all check" type="checkbox"/>&nbsp;全选</label></th>
                    <th style="width: 318px">商品名称</th>
                    <th style="width: 148px">单价</th>
                    <th style="width: 108px">数量</th>
                    <th style="width: 168px">小计</th>
                    <th>操作</th>
                </tr>
                </thead>
            </table>
            <div style="width: 300px;height: 100px;margin: auto;margin-top: 30px;z-index: 1;color:#ababab">
                <div style="margin-left:55px"><img src="../images/shoppingcart.png" alt=""></div>
                <div>购物车空空如也，快去选购吧！</div>
            </div>
            <table id="cartTable" style="margin: 0 auto;margin-top: -130px;z-index: 5">
                <thead style="display: none">

                </thead>
                <br>
                <% if(CartGoods.length > 0){ %>
                <tbody>
                <% for(var s = 0, k = 0, v = 0, i = 0;i < CartGoods.length;i++) { %>
                <tr>
                    <td class="checkbox"><input class="check-one check" type="checkbox"/></td>
                    <td class="goods">
                        <a style="text-decoration: none" href="/goods/GoodsDetail?GoodsId=<%= CartGoods[i].GoodsId %>">
                            <img width="80px" height="80px" align="center" src="/upload/<%= CartGoods[i].Pic %>" alt="">
                            <%= CartGoods[i].GoodsName %> </a></td>
                    <td class="price">
                        <%= CartGoods[i].Price %>元
                    </td>
                    <td class="count">
                        <span class="reduce">-</span>
                        <input class="count-input" type="text" value="<%= CartGoods[i].Count %>"/>
                        <% v = v + CartGoods[i].Count %>
                        <span class="add" onClick="loadFile(<%= CartGoods[i].Sno %>)">+</span>
                    </td>
                    <% k = CartGoods[i].Count * CartGoods[i].Price %>
                    <td class="subtotal"> <%= k %></td>
                    <td><a href='/goods/Cart' style='color:  rgba(24, 19, 213, 0.97)'
                           onclick="if(confirm('确认删除吗？')==true){
                                   this.href='DeleteCart?GoodsId=<%= CartGoods[i].GoodsId %>'
                                   alert('删除成功');}">删除</a></td>
                    <!--<td class="operation"><span class="delete">删除</span></td>-->
                    <% s = s + k %>
                </tr>
                <input type="hidden" name="Price" id="Price" value="<%= CartGoods[i].Price %>"/>
                <input type="hidden" name="Count" id="Count" value="<%= CartGoods[i].Count %>"/>
                <input type="hidden" name="GoodsId" id="GoodsId" value="<%= CartGoods[i].GoodsId %>"/>
                <input type="hidden" name="GoodsName" id="GoodsName" value="<%= CartGoods[i].GoodsName %>"/>
                <% } %>
                </tbody>
            </table>

            <div class="foot" id="foot" style="margin: 0 auto 100px;z-index: 5">
                <label class="fl select-all"><input type="checkbox" class="check-all check"/>&nbsp;全选</label>
                <a class="fl delete" id="deleteAll" href="javascript:;">
                    删除
                </a>
                <div class="fr closing">
                    <input type="submit" id="submitBtn" value="结算"/>

                </div>
                <div class="fr total">合计：￥<span id="priceTotal"><%= s %></span></div>
                <div class="fr selected" id="selected">已选商品
                    <span id="selectedTotal"><%= v %></span>件
                    <!--<span class="arrow up">︽</span>
                    <span class="arrow down">︾</span>-->
                </div>
                <div class="selected-view">
                    <div id="selectedViewList" class="clearfix">
                        <!--<div><img src="images/1.jpg"><span>取消选择</span></div>-->
                    </div>
                </div>
            </div>
                <% } %>
        </form>

    </div>

    <div id="foo">
        <div class="footMin1" style="margin-left: 105px">
            <img src="/images/foot1.png" alt="" width="220" height="130"/>
        </div>
        <div class="footMin1">
            <img src="/images/foot2.png" alt="" width="220" height="130"/>
        </div>
        <div class="footMin1">
            <img src="/images/foot3.png" alt="" width="220" height="130"/>
        </div>
        <div class="footMin1">
            <img src="/images/foot4.png" alt="" width="220" height="130"/>
        </div>
    </div>

     <footer>
         关于我们丨 友情链接丨 联系我们丨 诚聘英才丨 帮助中心丨 <br/>
         苏州市公安局备案编号110105014669丨苏ICP备14030992号丨互联网药品信息服务资格证编号（苏)-非经营性-2016-0912 <br/>
         Copyright @ 2014-2016 速康送药 4000000511.com版权所有
     </footer>
</div>

</body>
</html>
<script type="text/javascript">
    // 百度地图API功能
    var map = new BMap.Map("allmap");
    var point = new BMap.Point(116.331398, 39.897445);
    map.centerAndZoom(point, 12);

    function myFun(result) {
        var cityName = result.name;
        map.setCenter(cityName);
        document.getElementById('demo').innerHTML = '[' + cityName + ']';
    }
    var myCity = new BMap.LocalCity();
    myCity.get(myFun);
</script>
